﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.eforceglobal.crux.logging.Enums;
using com.eforceglobal.crux.DTOs;

namespace com.eforceglobal.crux.logging
{
    public class ApplicationLogger
    {
        public static void LogApplicationMessage(string messagetext, ApplicationLogType applicationlogtype, string stacktrace)
        {
            ApplicationLogMessageFacade applicationLogMessageFacade = new ApplicationLogMessageFacade();
            ApplicationLogMessageInformation applicationLogMessageInformation = new ApplicationLogMessageInformation();
            applicationLogMessageInformation.MessageText = messagetext;
            applicationLogMessageInformation.MessageTypeOrSource = applicationlogtype.ToString();
            applicationLogMessageInformation.MessageStackTrace = stacktrace;
            applicationLogMessageInformation.MessageDateTime = System.DateTime.Now;
            applicationLogMessageFacade.AddApplicationLogMessage(applicationLogMessageInformation);
        }
    }
}
